package main

import (
	"fmt"
	"os"
)

/*
	func Fprint(w io.Writer, a ...interface{}) (n int, err error)
	func Fprintln(w io.Writer, a ...interface{}) (n int, err error)
	func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
*/
func main() {
	f, err := os.OpenFile("fprint.dat", os.O_CREATE|os.O_WRONLY|os.O_APPEND|os.O_TRUNC, 0644)
	if err != nil {
		fmt.Println(err)
	}
	defer f.Close()

	fmt.Fprint(f, "hello", "world\n")
	fmt.Fprintln(f, "golang", "easy")

	fmt.Fprintf(f, "%d %s\n", 12, "gggo")
}
